spatialCooccur

spatialCooccur is an R package for analyzing spatial co-occurrence and neighborhood interactions in spatial transcriptomics data. It is built around Seurat objects and provides tools to compute co-occurrence enrichment, perform permutation-based tests, and visualize local interaction scores.

Installation

You can install the development version from GitHub using:

# install.packages("devtools")
devtools::install_github("juninamo/spatialCooccur")

see details here

Features

  • Simulate spatial transcriptomic layouts with generate_sim()
  • Calculate neighborhood co-occurrence enrichment with nhood_enrichment()
  • Identify local interaction zones using cooccur_local()
  • Permutation-based z-score estimation
  • Works seamlessly with Seurat spatial objects

1. Spatial Neighborhood Analysis (SNA)

To simulate spatial transcriptomic data and perform neighborhood enrichment analysis:

df = generate_sim(close_ratio = 1, n_types = 15, max_loc = 800, n_cells = 500, test_type = "circle", distance_param = 20, seed=1234)

# Run neighborhood enrichment analysis
nhood_enrichment_res <- nhood_enrichment(df, cluster_key = "cell_type", neighbors.k = 30, n_perms = 100, seed = 1234, n_jobs = 4)
nhood_enrichment_res$zscore

2. Spatial Co-localization Score (sCLS)

To compute co-localization scores for cell interactions:

cooccur_local_df <- cooccur_local(df, cluster_x = "cell_type_1", cluster_y = "cell_type_2", neighbors.k = 30, radius = 30)
summary(cooccur_local_df)

Citation

Jun Inamo, et al. XXX. bioRxiv, doi:[https://doi.org/XX](https://doi.org/XX)

Contact

For questions or issues related to this tutorial, please contact;

Name: Jun Inamo
Email:
Affiliation: Computational Omics and Systems Immunology (COSI) Lab, Division of Rheumatology and Center for Health AI, University of Colorado School of Medicine, CO, USA

The data presented here comes from the Yomogida lab through collaborating with XXX and YYY.

Acknowledgments

This research was supported by Japan Society for the Promotion of Science (JSPS) Grant-in-Aids for JSPS XXX.

  

License

This repository is provided under the MIT License.